package com.regvision.contacts.utils;

import com.regvision.contacts.App;

public class DensityUtils {
	
	/**
	 * dp to px
	 * @param dpValue
	 * @return
	 */
	public static int dp2px(float dpValue) {  
        final float scale = App.getContext().getResources().getDisplayMetrics().density;  
        return (int) (dpValue * scale + 0.5f);  
    } 
	
	/**
	 * px to dp
	 * @param pxValue
	 * @return
	 */
	public static int px2dp(float pxValue) {  
        final float scale = App.getContext().getResources().getDisplayMetrics().density;  
        return (int) (pxValue / scale + 0.5f);  
    } 

}
